﻿using System;
using System.Collections.Generic;

namespace BusinessLayer
{
    /// <summary>
    /// The privilege level.
    /// </summary>
    public class PrivilegeLevel : BusinessEntity
    {
        /// <summary>
        /// The privilege level repository.
        /// </summary>
        public class PrivilegeLevelRepository : Repository<PrivilegeLevel>
        {
            
        }

        /// <summary>
        /// The privilege level repository.
        /// </summary>
        public static PrivilegeLevelRepository Repository = new PrivilegeLevelRepository();

        /// <summary>
        /// Gets the id.
        /// </summary>
        public int Id
        {
            get { return (int)this.Get("Id"); }
        }

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        public string Name
        {
            get { return (string)this.Get("Name"); }
            set { this.Set("Name", value); }
        }

        
        /// <summary>
        /// Initializes a new instance of the <see cref="PrivilegeLevel"/> class.
        /// </summary>
        internal PrivilegeLevel(Dictionary<string, object> privilegeLevel)
        {
            this.Initialize(privilegeLevel);
        }

        /// <summary>
        /// Default constructor.
        /// Must call Initialize method before using.
        /// </summary>
        public PrivilegeLevel()
        {
        }


        /// <summary>
        /// Save the privilege level.
        /// </summary>
        public override void Save()
        {
            PrivilegeLevel.Repository.Write(this);
        }

    }
}
